<?php

?>  
<form action="" method="POST">

    <div class="panel panel-primary">
        <div class="panel-heading">Manage Products</div>
        <div style="padding: 10px;text-align: right;">
            <a class="btn btn-primary" href="<?php echo $template->url->getLink('product/create'); ?>">Tạo Mới</a>
            <button class="btn btn-danger" type="submit">Xóa</button>
        </div>
        <table class="table">
            <thead>
                <tr>
                    <th><input type="checkbox"></th>
                    <th>Image</th>
                    <th>Product Id</th>
                    <th>Title</th>
                    <th>Category</th>
                    <th>Action</th>
                </tr>
            </thead>
            <tbody>
                <?php foreach($template->get('aProducts') as $oProduct) : ?>
                    <tr>
                        <th><input type="checkbox" name="val[id][]" value="<?php echo $oProduct->product_id; ?>"></th>
                        <td><img style="max-width: 50px;max-height: 50px" src="<?php echo $template->url->getImageUrl($oProduct->image_url, 300); ?>" ></td>
                        <td><?php echo $oProduct->product_id; ?></td>
                        <td><?php echo $oProduct->title; ?></td>
                        <td><?php echo $oProduct->category_name; ?></td>
                        <td><a href="<?php echo $template->url->getLink('product/edit/'.$oProduct->product_id); ?>" class="btn btn-danger">Edit</a></td>
                    </tr>
                    <?php endforeach; ?>
            </tbody>
        </table>
    </div>
</form>